<?php
$ItColor = 1;
$ArFerramentas = Dracosys::getLoggedUser()->getFerramentas();
if (hasItem($ArFerramentas)):
    foreach ($ArFerramentas as $tFerramenta): $i = 1; //##Contador;
        ?>
        <div class="box-tools">
            <div class="suffix_1">
                <div class="box color<?= ($ItColor++ % 3) + 1 ?>">
                    <div class="header">
                        <h3><?= $tFerramenta->getStFerramenta() ?> <span><?= $tFerramenta->getStDescricao() ?></span></h3>
                        <img src="<?= DRA_VIEW_URL ?>images/<?= $tFerramenta->getStIconName() ?>" alt="" class="icon" />
                    </div>
                    <div class="content">
                        <table class="ferramentas_ranking" border="1" cellspacing="0" summary="Esta tabela mostra os 4 primeiros colocados do campeonato Italiano">
                            <caption>Primeiros 5 valores da ferramenta <?= $tFerramenta->getStFerramenta() ?></caption>
                            <thead>
                                <tr>
                                    <th id="header-num">&nbsp;</th>
                                    <th id="header-titulo" abbr="Pontos Ganhos">T&iacute;tulo</th>
                                    <th id="header-visualizar" abbr="Pontos Ganhos">Ver</th>
                                </tr>
                            </thead>
                            <tfoot>
                                <tr>
                                    <td colspan="3">&nbsp;</td>
                                </tr>
                            </tfoot>
                            <tbody>
                                <?php
                                if (hasItem($tFerramenta->getList())):
                                    foreach ($tFerramenta->getList() as $Ferramenta):
                                        $ArShowedData = $Ferramenta->getShowedData();
                                        ?>
                                        <tr>
                                            <td headers="header-num" class="num"><?=$i++?></td>
                                            <td headers="header-titulo" class="titulo"><?=$ArShowedData['title']?></td>
                                            <?php if( isset($ArShowedData['preview']) ): ?>
                                                <td headers="header-visualizar" class="visualizar"><a href="<?=$ArShowedData['preview']?>"><img src="<?=DRA_VIEW_URL?>images/view.png" title="Visualizar" alt="Visualizar" /></a></td>
                                            <?php else: ?>
                                                <td headers="header-visualizar" class="visualizar"> <?=$ArShowedData['data']?> </td>
                                            <?php endif; ?>
                                        </tr>
                                        <?php
                                    endforeach;
                                endif;
                                ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    <?php
    endforeach;
else:
    ?>
    <div class="no-data">SEM FERRAMENTAS HABILITADAS</div>
<?php
endif;
?>
